<template>
  <div class="home-page">
    <!-- 标题区域 -->
    <div class="header">
      <h1>油画艺术管理系统</h1>
      <p>探索、管理与欣赏油画艺术的数字平台</p>
    </div>

    <!-- 轮播图区域 -->
    <div class="carousel-section">
      <el-carousel :interval="1000" type="card" height="300px">
        <el-carousel-item v-for="item in carouselImages" :key="item">
          <img :src="item" class="carousel-image" />
        </el-carousel-item>
      </el-carousel>
    </div>

    <!-- 数据概览区域 -->
    <div class="data-overview">
      <div class="overview-card">
        <h3>1,258</h3>
        <p>油画作品总数</p>
      </div>
      <div class="overview-card">
        <h3>328</h3>
        <p>本月新增作品</p>
      </div>
      <div class="overview-card">
        <h3>¥4.2M</h3>
        <p>年度交易总额</p>
      </div>
      <div class="overview-card">
        <h3>89%</h3>
        <p>好评率</p>
      </div>
    </div>

    <!-- 功能区域 -->
    <div class="feature-section">
      <div class="feature-card" @click="navigateTo('page1')">
        <h2>数据统计</h2>
        <p>查看油画市场趋势与交易数据分析</p>
        <el-button type="primary">立即体验</el-button>
      </div>
      <div class="feature-card" @click="navigateTo('page2')">
        <h2>作品管理</h2>
        <p>管理油画作品信息与库存状态</p>
        <el-button type="primary">立即体验</el-button>
      </div>
      <div class="feature-card" @click="navigateTo('page4')">
        <h2>订单管理</h2>
        <p>处理油画购买订单与交易记录</p>
        <el-button type="primary">立即体验</el-button>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'

const router = useRouter()

// 轮播图图片列表
const carouselImages = ref([
  '/src/assets/0.png',
  '/src/assets/1.jpg',
  '/src/assets/2.png',
  '/src/assets/3.png'
])

// 页面导航
const navigateTo = (path) => {
  router.push(`/home/${path}`)
}
</script>

<style scoped>
.home-page {
  padding: 20px;
  background: linear-gradient(145deg, #F5EFE6 0%, #E0D8D0 100%);
  min-height: 100vh;
}

.header {
  text-align: center;
  margin-bottom: 40px;
  color: #2A3D66;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.header p {
  font-size: 1.2em;
  color: #5A4E41;
}

.carousel-section {
  margin: 40px auto;
  max-width: 1200px;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.data-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 40px auto;
  max-width: 1200px;
}

.overview-card {
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(90,78,65,0.08);
  transition: transform 0.3s ease;
}

.overview-card:hover {
  transform: translateY(-5px);
}

.overview-card h3 {
  font-size: 2em;
  color: #2A3D66;
  margin-bottom: 10px;
}

.overview-card p {
  color: #5A4E41;
  font-size: 1.1em;
}

.feature-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 40px auto;
  max-width: 1200px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.9);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(90,78,65,0.08);
  transition: all 0.3s ease;
  cursor: pointer;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(90,78,65,0.12);
}

.feature-card h2 {
  color: #2A3D66;
  margin-bottom: 15px;
}

.feature-card p {
  color: #5A4E41;
  margin-bottom: 20px;
  min-height: 44px;
}

.el-carousel__item {
  border-radius: 8px;
}

.el-button {
  background: linear-gradient(135deg, #2A3D66, #475F8D);
  border: none;
  padding: 12px 30px;
  font-size: 1.1em;
}

.el-button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}
</style> 